﻿#region

using System.Web.Mvc;
using CuongHanh.Models;
using CuongHanh.Security;
using CuongHanh.Service;
using Ext.Net.MVC;

#endregion

namespace CuongHanh.Controllers.BO
{
    [CustomAuthorize(Key = "Management", Description = "Manage all apps")]
    public class APriceHistoryController : ABaseController
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult ShowAdd(string containerId)
        {
            return ShowWindow("Add",
                    containerId,
                    new PriceHistory());
        }

        [HttpPost]
        public ActionResult Add(PriceHistory model)
        {
            UpdateResult result = PriceHistoryService.Insert(model);
            ShowWindow("wdModify",
                    false);
            ReloadStore("storeGvData");
            ShowNotification(result);
            return this.Direct();
        }

      
        public ActionResult GetDatas(int start,
                int limit,
                string query)
        {
            return Content(PriceHistoryService.Gets(start,
                    limit,
                    query),
                    "json");
        }
    }
}
